package com.ruoyi.order.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.order.mapper.UserItemOrderMapper;
import com.ruoyi.order.domain.UserItemOrder;
import com.ruoyi.order.service.IUserItemOrderService;

/**
 * 用户订单Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-09
 */
@Service
public class UserItemOrderServiceImpl implements IUserItemOrderService 
{
    @Autowired
    private UserItemOrderMapper userItemOrderMapper;

    /**
     * 查询用户订单
     * 
     * @param id 用户订单主键
     * @return 用户订单
     */
    @Override
    public UserItemOrder selectUserItemOrderById(Integer id)
    {
        return userItemOrderMapper.selectUserItemOrderById(id);
    }

    /**
     * 查询用户订单列表
     * 
     * @param userItemOrder 用户订单
     * @return 用户订单
     */
    @Override
    public List<UserItemOrder> selectUserItemOrderList(UserItemOrder userItemOrder)
    {
        return userItemOrderMapper.selectUserItemOrderList(userItemOrder);
    }

    /**
     * 新增用户订单
     * 
     * @param userItemOrder 用户订单
     * @return 结果
     */
    @Override
    public int insertUserItemOrder(UserItemOrder userItemOrder)
    {
        userItemOrder.setCreateTime(DateUtils.getNowDate());
        return userItemOrderMapper.insertUserItemOrder(userItemOrder);
    }

    /**
     * 修改用户订单
     * 
     * @param userItemOrder 用户订单
     * @return 结果
     */
    @Override
    public int updateUserItemOrder(UserItemOrder userItemOrder)
    {
        userItemOrder.setUpdateTime(DateUtils.getNowDate());
        return userItemOrderMapper.updateUserItemOrder(userItemOrder);
    }

    /**
     * 批量删除用户订单
     * 
     * @param ids 需要删除的用户订单主键
     * @return 结果
     */
    @Override
    public int deleteUserItemOrderByIds(Integer[] ids)
    {
        return userItemOrderMapper.deleteUserItemOrderByIds(ids);
    }

    /**
     * 删除用户订单信息
     * 
     * @param id 用户订单主键
     * @return 结果
     */
    @Override
    public int deleteUserItemOrderById(Integer id)
    {
        return userItemOrderMapper.deleteUserItemOrderById(id);
    }
}
